<template>
  <div class="word-window window-base">
    <div class="window-header">
      <div class="window-title">
        <img src="@/assets/icons/word.svg" class="app-icon" />
        <span>文档1 - Word</span>
      </div>
      <div class="window-buttons">
        <span class="minimize">─</span>
        <span class="maximize">□</span>
        <span class="close" @click="$router.push('/')">×</span>
      </div>
    </div>

    <div class="menu-bar">
      <span>文件</span>
      <span>开始</span>
      <span>插入</span>
      <span>布局</span>
      <span>引用</span>
      <span>审阅</span>
      <span>视图</span>
      <span>帮助</span>
    </div>

    <div class="toolbar">
      <div class="tool-group">
        <button class="tool">
          <i class="fas fa-paste"></i>
          <span>粘贴</span>
        </button>
        <div class="divider"></div>
        <button class="tool">
          <i class="fas fa-cut"></i>
          <span>剪切</span>
        </button>
        <button class="tool">
          <i class="fas fa-copy"></i>
          <span>复制</span>
        </button>
      </div>

      <div class="tool-group">
        <select class="font-family">
          <option>微软雅黑</option>
          <option>宋体</option>
          <option>Arial</option>
          <option>Times New Roman</option>
          <option>Calibri</option>
        </select>
        <select class="font-size">
          <option>8</option>
          <option>9</option>
          <option>10</option>
          <option>11</option>
          <option>12</option>
          <option>14</option>
          <option>16</option>
          <option>18</option>
          <option>20</option>
          <option>22</option>
          <option>24</option>
          <option>26</option>
          <option>28</option>
          <option>36</option>
          <option>48</option>
          <option>72</option>
        </select>
        <div class="divider"></div>
        <button class="tool">
          <i class="fas fa-bold"></i>
        </button>
        <button class="tool">
          <i class="fas fa-italic"></i>
        </button>
        <button class="tool">
          <i class="fas fa-underline"></i>
        </button>
        <button class="tool">
          <i class="fas fa-strikethrough"></i>
        </button>
        <button class="tool">
          <i class="fas fa-subscript"></i>
        </button>
        <button class="tool">
          <i class="fas fa-superscript"></i>
        </button>
      </div>

      <div class="tool-group">
        <button class="tool">
          <i class="fas fa-align-left"></i>
        </button>
        <button class="tool">
          <i class="fas fa-align-center"></i>
        </button>
        <button class="tool">
          <i class="fas fa-align-right"></i>
        </button>
        <button class="tool">
          <i class="fas fa-align-justify"></i>
        </button>
        <div class="divider"></div>
        <button class="tool">
          <i class="fas fa-list-ul"></i>
        </button>
        <button class="tool">
          <i class="fas fa-list-ol"></i>
        </button>
        <button class="tool">
          <i class="fas fa-indent"></i>
        </button>
        <button class="tool">
          <i class="fas fa-outdent"></i>
        </button>
      </div>

      <div class="tool-group">
        <button class="tool">
          <i class="fas fa-table"></i>
          <span>表格</span>
        </button>
        <button class="tool">
          <i class="fas fa-image"></i>
          <span>图片</span>
        </button>
        <button class="tool">
          <i class="fas fa-shapes"></i>
          <span>形状</span>
        </button>
      </div>
    </div>

    <div class="content">
      <div class="document-overlay">
        <div class="paragraph">
          关于办公室工作效率提升的建议
        </div>
        <div class="paragraph">
          为提高我司员工的工作效率，经过调研，现提出以下几点建议：
        </div>
        <div class="paragraph">
          1. 合理安排工作时间，建议采用番茄工作法，每25分钟为一个工作周期。
        </div>
        <div class="paragraph">
          2. 注意工作环境整洁，保持桌面整齐有助于提升工作心情。
        </div>
        <div class="paragraph">
          3. 适当活动和休息，避免久坐带来的职业病。
        </div>
        <div class="paragraph">
          4. 做好工作计划，合理分配任务优先级。
        </div>
      </div>

      <div class="game-layer">
        <div class="editor" contenteditable="true">
          在此处输入文字
        </div>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
@use '@/styles/variables' as *;

.word-window {
  @extend %window-base;
  width: 80vw;
  height: 80vh;

  .content {
    position: relative;
    flex: 1;
    padding: 40px;
    background: #F0F0F0;
    overflow: auto;

    .document-overlay {
      position: absolute;
      top: 40px;
      left: 50%;
      transform: translateX(-50%);
      width: 21cm;
      min-height: 29.7cm;
      padding: 2.54cm;
      background: white;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      z-index: 2;
      pointer-events: none;

      .paragraph {
        margin-bottom: 1em;
        line-height: 1.6;
        color: #333;
        font-size: 14px;
        font-family: "微软雅黑", sans-serif;
        opacity: 0.8;
      }
    }

    .game-layer {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0.3;
      z-index: 1;
    }

    .editor {
      width: 21cm;
      min-height: 29.7cm;
      padding: 2.54cm;
      margin: 0 auto;
      background: white;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      outline: none;
    }
  }

  .menu-bar {
    display: flex;
    gap: 16px;
    padding: 4px 8px;
    background: #F5F5F5;
    border-bottom: 1px solid #DDD;
    
    span {
      padding: 4px 8px;
      cursor: pointer;
      
      &:hover {
        background: #E5E5E5;
      }
    }
  }
  
  .toolbar {
    display: flex;
    gap: 16px;
    padding: 8px;
    background: #F5F5F5;
    border-bottom: 1px solid #DDD;
    
    .tool-group {
      display: flex;
      gap: 4px;
      padding-right: 16px;
      border-right: 1px solid #DDD;
      align-items: center;
      
      &:last-child {
        border-right: none;
      }
    }
    
    .tool {
      padding: 4px;
      background: none;
      border: none;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      font-size: 12px;
      
      &:hover {
        background: #E5E5E5;
      }
      
      i {
        font-size: 16px;
      }
    }
    
    .divider {
      width: 1px;
      height: 20px;
      background: #DDD;
      margin: 0 4px;
    }
    
    select {
      padding: 2px 4px;
      border: 1px solid #DDD;
      border-radius: 2px;
      
      &.font-family {
        width: 120px;
      }
      
      &.font-size {
        width: 60px;
      }
    }
  }
}
</style> 